#ifndef __STATICDATA_SIMPLETABLEFRAME_H__
#define __STATICDATA_SIMPLETABLEFRAME_H__

#include "ISimpleTableFrame.h"
#include "Hasher.h"
#include "AtomString.h"

#include <map>
#include <vector>

class CSimpleTableFrame :
	public ISimpleTableFrame
{
protected:
	typedef hash_map< std::string,int, str_hash >	FieldColHashMap;
	typedef hash_map< int,std::string >	ColFieldHashMap;
	typedef FieldColHashMap::value_type FieldColHashPair;
	typedef ColFieldHashMap::value_type ColFieldHashPair;

	//typedef hash_map< AtomString,int >	FieldColHashMap_AS;
	//typedef hash_map< int,AtomString >	ColFieldHashMap_AS;
	//typedef FieldColHashMap_AS::value_type FieldColHashPair_AS;
	//typedef ColFieldHashMap_AS::value_type ColFieldHashPair_AS;

	typedef std::pair< std::string,int>  FieldColPair;
	typedef std::map< std::string,int>   FieldColMap;
	typedef std::pair< int,std::string > ColFieldPair;
	typedef std::map< int,std::string >  ColFieldMap;

	typedef std::pair< AtomString,int>  FieldColPair_AS;
	typedef std::map< AtomString,int>   FieldColMap_AS;
	typedef std::pair< int,AtomString > ColFieldPair_AS;
	typedef std::map< int,AtomString >  ColFieldMap_AS;

public:
	CSimpleTableFrame();
	virtual ~CSimpleTableFrame();

	///
	virtual void	AddPair( int nCol,const std::string& strField )
	{
		AddPair(strField, nCol);
	}

	///
	virtual void	AddPair( const std::string& strField,int nCol );
	
	///
	virtual int	GetColByField( const std::string& strField );
	///
	virtual int	GetColByField( const AtomString& );
	
	///
	virtual std::string GetFieldByCol( int nCol );

	///
	virtual int	GetFieldCount();

private:
	FieldColMap	m_mapFieldColMap;
	ColFieldMap	m_mapColFieldMap;

	FieldColHashMap	m_mapFieldColHashMap;
	ColFieldHashMap	m_mapColFieldHashMap;

	FieldColMap_AS	m_mapFieldColMap_AS;
	ColFieldMap_AS	m_mapColFieldMap_AS;

	//FieldColHashMap_AS	m_mapFieldColHashMap_AS;
	//ColFieldHashMap_AS	m_mapColFieldHashMap_AS;

	std::vector<int> m_vecIndexMap;
};

#endif //__STATICDATA_SIMPLETABLEFRAME_H__
